import request from '@/utils/request'

// 查询销售订单列表
export function listOrder(query) {
  return request({
    url: '/system/saleOrder/list',
    method: 'get',
    params: query
  })
}

// 查询销售订单详细
export function getOrder(id) {
  return request({
    url: '/system/saleOrder/' + id,
    method: 'get'
  })
}
// 订单产品明细
export function getOrderdetail(id) {
  return request({
    url: '/system/saleOrder/partMsg/' + id,
    method: 'get'
  })
}
// 订单操作明细
export function getcz(id) {
  return request({
    url: '/system/saleOrder/orderMsg_get/' + id,
    method: 'get'
  })
}

// 新增销售订单
export function addOrder(data) {
  return request({
    url: '/system/saleOrder',
    method: 'post',
    data: data
  })
}

// 修改销售订单
export function updateOrder(data) {
  return request({
    url: '/system/saleOrder',
    method: 'put',
    data: data
  })
}

// 删除销售订单
export function delOrder(id) {
  return request({
    url: '/system/saleOrder/' + id,
    method: 'delete'
  })
}
// 新增报价单
export function addquotation(data) {
  return request({
    url: '/system/saleOrder/saleOrder_write',
    method: 'post',
    data: data
  })
}
// 新增报价单订单行
export function addorderzz(id) {
  return request({
    url: '/system/saleOrder/saleOrderPart_insert/'+id,
    method: 'post'
  })
}
